<!DOCTYPE html>
<html>
<head>
<title>{$site_name}-编辑产品-会员中心</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">

<tc_include file="Public:head" />
</head>

<body class="body-white" id="top">
	<tc_include file="Public:nav" />

	<div class="container tc-main">
        <div class="row">
            <div class="span2">
                <tc_include file="Public:usernav"/>
            </div>
            <div class="span10">
               <ul class="nav nav-tabs">
					<li <eq name="do" value="list">class="active"</eq>><a href="{:leuu('Qrcode/center/product', array('do' => 'list'))}">产品列表</a></li>
					<li <eq name="do" value="add">class="active"</eq>><a href="{:leuu('Qrcode/center/add_pro', array('do' => 'add'))}">编辑产品</a></li>
				</ul>
               <div class="tab-content">
                   	<div class="tab-pane active" id="one">
	                <form id="ff" class="form-horizontal js-forgot-form" action="{:leuu('Qrcode/center/edit_pro')}" method="post">
	                	<input type="hidden" name="id" value="{$info.pid}">
						<div class="control-group">
						  <label class="control-label" for="inputcat">产品分类</label>
						  <div class="controls">
							<select id="inputcat" name="category" class="span4">
								<option value="0">请选择产品分类</option>
								<foreach name="category" item="val">
									<option value="{$val.id}" <if condition="$val['id'] eq $info['category']">selected</if>>{$val.name}</option>
								</foreach>
							</select>
							<span class="help-inline"></span>
						  </div>
						</div>
						<div class="control-group">
						  <label class="control-label" for="inputname">产品名称</label>
						  <div class="controls">
							<input type="text" id="inputname" name="name" placeholder="请输入产品名称" class="span4" value="{$info.name}">
							<span class="help-inline"></span>
						  </div>
						</div>
						<div class="control-group">
						  <label class="control-label" for="inputdesc">产品详情</label>
						  <div class="controls">
							<script type="text/plain" id="inputdesc" name="description">{$info.description|htmlspecialchars_decode}</script>
							<span class="help-inline"></span>
						  </div>
						</div>
						<div class="control-group {$isShowCode}">
							<label class="control-label" for="UnitCode">产品单元识别代码（选填）</label>
							<div class="controls">
								<input type="text" name="UnitCode" placeholder="请输入产品单元识别代码" class="span4" value="{$info.unitcode}">
								<span class="help-inline">农药类请填此项，内容为申请的前11位，<a class="btn-mini js-ajax-dialog-btn" data-msg="1.二维码内容由追溯网址、单元识别代码等组成。通过扫描二维码应当能够识别显示农药名称、登记证持有人名称等信息。2.单元识别代码由32位阿拉伯数字组成。第1位为该产品农药登记类别代码，“1”代表登记类别代码为PD，“2”代表登记类别代码为WP，“3”代表临时登记；第2-7位为该产品农药登记证号的后六位数字，登记证号不足六位数字的，可从中国农药信息网（www.chianpesticide.goc.cn）查询；第8位为生产类型，“1”代表农药登记证持有人生产，“2”代表委托加工，“3”代表委托分装；第9-11位为产品规格码，企业自行编制；第12-32位为随机码。" data-ok="" data-cacel="取消" >点击查看具体信息</a></span>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for=""></label>
							<div class="controls">
								<button class="btn btn-primary js-ajax-submit span4" type="button" style="margin-left: 0px" id="subbtn">确定</button>
							</div>
						</div>
					</form>
                   </div>
               </div>
            </div>
        </div>
		<tc_include file="Public:footer" />
	</div>
	<!-- /container -->
	<tc_include file="Public:scripts" />
	<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.DIMAUB;
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
  	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript">
		$('#subbtn').click(function() {
	        $.post("{:leuu('Qrcode/center/edit_pro')}",$('#ff').serialize(),function(data) {
	        	document.getElementById('subbtn').disabled=true;
	          if(data.status == 1) {
	            if(data.url) {
	              window.location.href=data.url;
	            } else {
	              location.reload();
	            }
	          } else {
	            alert(data.info);
	          }
	        })
	      });
		editor1 = new baidu.editor.ui.Editor({
	          toolbars: [
	              ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc','simpleupload','insertvideo']
	          ],
	          autoHeightEnabled: false,
	          autoFloatEnabled: true,
	          initialFrameWidth:'98%',
	          initialFrameHeight:600
	      });
	      editor1.render('inputdesc');
	      try {
	        editor1.sync();
	      } catch (err) {
	      }
	</script>
</body>
</html>